Part Number Hot Search : 
5241605C 63410 MK325B 15B10 HCT4051 55976 MPSD04 MAX170
Product Description
Full Text Search
 

To Download R10 Datasheet File

  If you can't view the Datasheet, Please click here to try to view without PDF Reader .  
 
 


  Datasheet File OCR Text:
  ? rej05b0811_0110 rev.1.10 2007.11 page 1 of 16 application notes m16c/26a group sample program (lux meter) 1. summary this sample program provides the functionality of a lux, or illu minance meter by using the renesas starter kit for m16c/26a (r0k33026as000be) and an extension board. 2. introduction the example described in this document appl ies to the microcomputers listed below: microcomputers: m16c26a this sample program runs on the renesas starter kit for m16c/26a (r0k33026as000be). prepare an extension board available for the renesas starter kit or create a circuit similar to the one shown in the example ci rcuit on page 13 and then connect it to the starter kit. this program uses rsk_lib. for details about rsk_lib, see the rs k_lib reference manual. (rsk_lib is the library software provid ed for use with the renesas starter kit for m16c/26a.) the extension board used here is a product from pi system co., ltd. illuminance mete r
? rej05b0811_0110 rev.1.10 2007.11 page 2 of 16 m16c/26a group sample program (lux meter) 3. port arrangement 4. operational outline illuminance levels ( ? 4 to 4) are shown on liquid crystal disp lay by using an illuminance sensor. determine the criterion for brightness in 5 seconds after the pressing the reset switch. then, when light is impinged on the illuminance sensor to increase brightness, the illuminance level displayed on lcd changes f rom 0 to 1, 2, 3 and 4. conversely, when brightness is reduced, the illumi nance level displayed on lcd changes from 0 to ? 1, ? 2, ? 3 and ? 4. ? timer a0 (timer mode, main 2 ms cycle) this timer counts 2 milliseconds using the main clock of the microcomputer as the count source. it is used as the basic timer of rsk_lib. time management, lcd display management and ad input are performed usi ng this timer. ? ad0 (single-shot mode, illu minance input measurement) analog voltages are converted to digital data using the ma in clock of the microcomputer as a conversion clock. more specifically, the analog voltages output from the illuminance sensor are a/d converted. l e e l v l ? i ? g ? h ? t ? 0 10mhz -$% p100 xin p60 p61 p62 p63 p90 p91 lcd e lcd rs lcd d7 lcd d6 lcd d5 lcd d4 m30260f8agp luxmeter when light is impinged on illuminance sensor, illuminance level increases. -*()5 -&7&- liquid crystal display m16c26a illuminance sensor 5seconds elapsed reset switch depressed liquid crystal display m16c26a
? rej05b0811_0110 rev.1.10 2007.11 page 3 of 16 m16c/26a group sample program (lux meter) 5. operational specification (1) the ad value is read-in for 5 s econds after the reset switch is depressed, and the values read during that time are averaged to yield an initial illuminance. (2) the initial illuminance ?0? is displayed. the initial illuminance and the current illuminance levels are compared in table 1. * the ad values are set by calling the common function ?ad average? (rl_adveraging). within the function, a value is sampled 6 times, and the sample d values except the maximum and minimum values are averaged, the result of which is returned. this average value is acquired 8 times, the average of which is made a fixed value. table 1. initial illuminance and current illuminance levels initial illuminance level - 0.70v - 1.10v - 1.60v 1.60v - -4 - 0.10v - 0.40v - 0.90v - 1.10v -3 - 0.30v - 0.60v - 1.10v - 1.40v -2 - 0.50v - 0.80v - 1.30v - 1.70v -1 - 0.60v - 1.00v - 1.50v - 2.00v 0 - 0.80v - 1.20v - 1.70v - 2.10v 1 - 1.00v - 1.40v - 1.90v - 2.30v 2 - 1.20v - 1.60v - 2.10v - 2.50v 3 - 1.40v - 1.80v - 2.30v - 2.60v displayed level 4 1.40 v - 1.80v - 2.30v - 2.60v - (1)after reset switch depressed a d u s j t ? (2)initial illuminance displayed (5) current illuminance input level changes (3) changed level displayed le e l v 0 ? le e l v - ? 3 li ght l ? i ? g ? h ? t ? l ? i ? g ? h ? t figure 2. example of program operation (4)5 seconds elapsed
? rej05b0811_0110 rev.1.10 2007.11 page 4 of 16 m16c/26a group sample program (lux meter) 6. definition of the rsk functionality and the rs k_lib apis and common functions used by the lux meter 6.1 definition of the rsk functionality rskdefine.h file in this application, the following functionalities (those shown in red) are set. individual definition of e ach selected functionality /********************************************************* the boot information on cpu is defined usually, th is mode is used *********************************************************/ #define _cpu_m16c26a_normal_mod /* use in low power mode can be performed. */ //#define _cpu_m16c26a_32khz_mod /* use of access of a flash can be performed. */ //#define _cpu_m16c26a_dataflasf_use /******************************************************** the hardware function wh ich rsk supports is chosen /********************************************************/ //#define _use_key //#define _use_buzzer #define _option_use_ad //#define _option_use_com_rx //#define _option_use_com_tx //#define _opti on_use_infraedrx //#define _opti on_use_infraedtx //#define _option_use_sw //#define _option_use_led //#define _option_use_io ? #if defined _option_use_ad /* define illumimeter adc */ #define _option_use_ad0 /* define vr adc */ //#define _option_use_ad24 #endif lux meter input ad
? rej05b0811_0110 rev.1.10 2007.11 page 5 of 16 m16c/26a group sample program (lux meter) 6.2 apis and common functions used apistatustype rl_settimerreq( unsigned int timervalue, char timermode, int *timerno, int *ercode ); apistatustype rl_starttimer( int timerno, int *ercode ); apistatustype rl_checktimer( int timerno, int *ercode ); apistatustype rl_canceltimer( int timerno, int *ercode ); apistatustype rl_putc_lcd( char ylocation, char outc, int *ercode ); *ercode ); apistatustype rl_putc_lcdloc( char xlocation, char ylocation, char rvtime, char outc, int *ercode ); apistatustype rl_puts_lcdloc( char xlocation, char ylocation, char rvtime, const char far* outc, int *ercode ); apistatustype rl_start_adc( int adidentfier, int *ercode ); int rl_adaveraging( int adlogicalno, int *adaverage, int *ercode ); void rl_errorhook( int funcno, int errorno ); for details about the apis and co mmon functions used by the sample program (lux meter), see the renesas starter kit library v.1 .00 reference manual.
? rej05b0811_0110 rev.1.10 2007.11 page 6 of 16 m16c/26a group sample program (lux meter) 7. flowchart lux meter clear display on lcd measure reference illuminance show the initial screen measure illuminance process measured value display request ad start
? rej05b0811_0110 rev.1.10 2007.11 page 7 of 16 m16c/26a group sample program (lux meter) 8. tutorial 1 launch the hew by double-clicking its icon. 2 change the session name from ?default session? to ?sessionm16c_e8_system.?
? rej05b0811_0110 rev.1.10 2007.11 page 8 of 16 m16c/26a group sample program (lux meter) 3 select ?m30260f8a? for device. select ?download emulat or firmware? for mode.
? rej05b0811_0110 rev.1.10 2007.11 page 9 of 16 m16c/26a group sample program (lux meter) check the box labeled ?power supply is carried out. (max 300ma)? and then select ?5.0v.?
? rej05b0811_0110 rev.1.10 2007.11 page 10 of 16 m16c/26a group sample program (lux meter) 4 in the program and the work ram text boxes of firmware location address, enter ?f a0? and ?0b8? respectively. leave the box labeled ?debug a progr am using the wdt? unchecked.
? rej05b0811_0110 rev.1.10 2007.11 page 11 of 16 m16c/26a group sample program (lux meter) 5 choose dow nload from the debug tab and download a module. the upper-side choices for download show the location from which a pr oject was downloaded.
? rej05b0811_0110 rev.1.10 2007.11 page 12 of 16 m16c/26a group sample program (lux meter) 6 click ?start after reset? to start program execution. 7 please do "cancellation" when "t he file is opened" window opens.
? rej05b0811_0110 rev.1.10 2007.11 page 13 of 16 m16c/26a group sample program (lux meter) 9. example circuit 10. part list part name part no. q?ty manufact urer type number value remark illuminance sensor u2 1 toshiba tps851 op-amp u4 1 ti lm358psr laminated ceramic capacitor c7 - c8 2 panasonic ecj-1vf1h104 100nf/50v electrolytic capacitor c9 1 panasonic ece-v1hs010sr 1uf/50v chip resistor r6 1 rohm mcR10ezh f102 1k 1/8w,1%(5% also acceptable) chip resistor r8,R10 2 rohm mcR10ezhf472 4.7k 1/8w,1% chip resistor r9 1 rohm mcR10ezh f103 10k 1/8w,1%(5% also acceptable) pcb header ja1,ja2 2 molex 10-88-1261 26- pin male, 2-row, vertical type
? rej05b0811_0110 rev.1.10 2007.11 page 14 of 16 m16c/26a group sample program (lux meter) 11. web sitet renesas technology web site http://www.renesas.com/
? rej05b0811_0110 rev.1.10 2007.11 page 15 of 16 m16c/26a group sample program (lux meter) revision history content of revision rev. date of issue page points 1.00 2006.06.30 - first revision issued 1.10 2007.11.29 - rsk_lib apis supported
? rej05b0811_0110 rev.1.10 2007.11 page 16 of 16 m16c/26a group sample program (lux meter)


▲Up To Search▲   

 
Price & Availability of R10

All Rights Reserved © IC-ON-LINE 2003 - 2022  

[Add Bookmark] [Contact Us] [Link exchange] [Privacy policy]
Mirror Sites :  [www.datasheet.hk]   [www.maxim4u.com]  [www.ic-on-line.cn] [www.ic-on-line.com] [www.ic-on-line.net] [www.alldatasheet.com.cn] [www.gdcy.com]  [www.gdcy.net]


 . . . . .
  We use cookies to deliver the best possible web experience and assist with our advertising efforts. By continuing to use this site, you consent to the use of cookies. For more information on cookies, please take a look at our Privacy Policy. X